home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / share / xcb / xcb.xsd < prev    next >
Encoding:
Extensible Markup Language  |  2008-09-17  |  9.1 KB  |  235 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Copyright (C) 2004 Josh Triplett.  All Rights Reserved.
  4.  
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11.  
  12. The above copyright notice and this permission notice shall be included in all
  13. copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  19. ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21.  
  22. Except as contained in this notice, the names of the authors or their
  23. institutions shall not be used in advertising or otherwise to promote the
  24. sale, use or other dealings in this Software without prior written
  25. authorization from the authors.
  26. -->
  27. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  28.  
  29.   <!-- The root element -->
  30.   <xsd:element name="xcb">
  31.     <xsd:complexType>
  32.       <xsd:group ref="macro" minOccurs="0" maxOccurs="unbounded" />
  33.       <xsd:attribute name="header" type="xsd:string" use="required" />
  34.       <xsd:attribute name="extension-xname" type="xsd:string" use="optional" />
  35.       <xsd:attribute name="extension-name"  type="xsd:string" use="optional" />
  36.       <xsd:attribute name="extension-multiword" type="xsd:boolean" use="optional" default="false" />
  37.       <xsd:attribute name="major-version"   type="xsd:integer" use="optional" />
  38.       <xsd:attribute name="minor-version"   type="xsd:integer" use="optional" />
  39.     </xsd:complexType>
  40.   </xsd:element>
  41.  
  42.   <!-- Padding -->
  43.   <xsd:element name="pad">
  44.     <xsd:complexType>
  45.       <xsd:attribute name="bytes" type="xsd:integer" use="required" />
  46.     </xsd:complexType>
  47.   </xsd:element>
  48.  
  49.   <!-- Type for fields or parameters with attributes "name" and "type" -->
  50.   <xsd:complexType name="var">
  51.     <xsd:attribute name="name" type="xsd:string" use="required" />
  52.     <xsd:attribute name="type" type="xsd:string" use="required" />
  53.   </xsd:complexType>
  54.  
  55.   <!-- field replaces FIELD, PARAM, and REPLY. -->
  56.   <xsd:element name="field" type="var" />
  57.  
  58.   <!-- list replaces ARRAYFIELD, LISTPARAM, and ARRAYREPLY.  The name and type
  59.        are specified as attributes.  The content is an expression giving the
  60.        length. -->
  61.   <xsd:element name="list">
  62.     <xsd:complexType>
  63.       <xsd:complexContent>
  64.         <xsd:extension base="var">
  65.           <xsd:group ref="expression" minOccurs="0" maxOccurs="1" />
  66.         </xsd:extension>
  67.       </xsd:complexContent>
  68.     </xsd:complexType>
  69.   </xsd:element>
  70.  
  71.   <!-- Expressions -->
  72.   <xsd:group name="expression">
  73.     <xsd:choice>
  74.       <xsd:element name="op">
  75.         <xsd:complexType>
  76.           <xsd:sequence>
  77.             <xsd:group ref="expression" />
  78.             <xsd:group ref="expression" />
  79.           </xsd:sequence>
  80.           <xsd:attribute name="op" use="required">
  81.             <xsd:simpleType>
  82.               <xsd:restriction base="xsd:string">
  83.                 <xsd:pattern value="\+|-|\*|/|&|<<" />
  84.               </xsd:restriction>
  85.             </xsd:simpleType>
  86.           </xsd:attribute>
  87.         </xsd:complexType>
  88.       </xsd:element>
  89.       <xsd:element name="fieldref" type="xsd:string" />
  90.       <xsd:element name="value" type="dec-or-hex-integer" />
  91.       <xsd:element name="bit" type="xsd:integer" />
  92.     </xsd:choice>
  93.   </xsd:group>
  94.   
  95.   <!-- Fields in requests that are calculated from other information, not
  96.        supplied by the caller. -->
  97.   <xsd:element name="exprfield" >
  98.     <xsd:complexType>
  99.       <xsd:complexContent>
  100.         <xsd:extension base="var">
  101.           <xsd:group ref="expression" />
  102.         </xsd:extension>
  103.       </xsd:complexContent>
  104.     </xsd:complexType>
  105.   </xsd:element>
  106.  
  107.   <!-- BITMASK/LISTofVALUE parameter pairs. -->
  108.   <xsd:element name="valueparam">
  109.     <xsd:complexType>
  110.       <xsd:attribute name="value-mask-type" type="xsd:string" use="required" />
  111.       <xsd:attribute name="value-mask-name" type="xsd:string" use="required" />
  112.       <xsd:attribute name="value-list-name" type="xsd:string" use="required" />
  113.     </xsd:complexType>
  114.   </xsd:element>
  115.  
  116.   <xsd:group name="fields">
  117.     <xsd:choice>
  118.       <xsd:element ref="pad" />
  119.       <xsd:element ref="field" />
  120.       <xsd:element ref="list" />
  121.     </xsd:choice>
  122.   </xsd:group>
  123.  
  124.   <!-- Type for a structure -->
  125.   <xsd:complexType name="struct">
  126.     <xsd:group ref="fields" minOccurs="1" maxOccurs="unbounded" />
  127.     <xsd:attribute name="name" type="xsd:string" use="required" />
  128.   </xsd:complexType>
  129.  
  130.   <!-- Type for a packet structure -->
  131.   <xsd:complexType name="packet-struct">
  132.     <xsd:group ref="fields" minOccurs="0" maxOccurs="unbounded" />
  133.     <xsd:attribute name="name" type="xsd:string" use="required" />
  134.     <xsd:attribute name="number" type="xsd:integer" use="required" />
  135.   </xsd:complexType>
  136.  
  137.   <!-- Type for a packet structure copy -->
  138.   <xsd:complexType name="packet-struct-copy">
  139.     <xsd:attribute name="name" type="xsd:string" use="required" />
  140.     <xsd:attribute name="number" type="xsd:integer" use="required" />
  141.     <xsd:attribute name="ref" type="xsd:string" use="required" />
  142.   </xsd:complexType>
  143.  
  144.   <!-- Type for hex integers -->
  145.   <xsd:simpleType name="hex-integer">
  146.     <xsd:restriction base="xsd:string">
  147.       <xsd:pattern value="0x[0-9a-fA-F]+" />
  148.     </xsd:restriction>
  149.   </xsd:simpleType>
  150.  
  151.   <!-- Type for integers in either decimal or hex -->
  152.   <xsd:simpleType name="dec-or-hex-integer">
  153.     <xsd:union memberTypes="xsd:integer hex-integer" />
  154.   </xsd:simpleType>
  155.  
  156.   <xsd:group name="macro">
  157.     <xsd:choice>
  158.       <xsd:element name="request">
  159.         <xsd:complexType>
  160.           <xsd:sequence>
  161.             <xsd:choice minOccurs="0" maxOccurs="unbounded">
  162.               <xsd:group ref="fields" />
  163.               <xsd:element ref="exprfield" />
  164.               <xsd:element ref="valueparam" />
  165.             </xsd:choice>
  166.             <xsd:element name="reply" minOccurs="0" maxOccurs="1">
  167.               <xsd:complexType>
  168.                 <xsd:choice minOccurs="1" maxOccurs="unbounded">
  169.                   <xsd:group ref="fields" />
  170.                   <xsd:element ref="valueparam" />
  171.                 </xsd:choice>
  172.               </xsd:complexType>
  173.             </xsd:element>
  174.           </xsd:sequence>
  175.           <xsd:attribute name="name" type="xsd:string" use="required" />
  176.           <xsd:attribute name="opcode" type="xsd:integer" use="required" />
  177.           <xsd:attribute name="combine-adjacent" type="xsd:boolean"
  178.                          use="optional"/>
  179.         </xsd:complexType>
  180.       </xsd:element>
  181.       <xsd:element name="event">
  182.         <xsd:complexType>
  183.           <xsd:complexContent>
  184.             <xsd:extension base="packet-struct">
  185.               <xsd:attribute name="no-sequence-number" type="xsd:boolean"
  186.                              use="optional" />
  187.             </xsd:extension>
  188.           </xsd:complexContent>
  189.         </xsd:complexType>
  190.       </xsd:element>
  191.       <xsd:element name="eventcopy" type="packet-struct-copy" />
  192.       <xsd:element name="error" type="packet-struct" />
  193.       <xsd:element name="errorcopy" type="packet-struct-copy" />
  194.       <xsd:element name="struct" type="struct" />
  195.       <xsd:element name="union" type="struct" />
  196.       <xsd:element name="xidtype">
  197.         <xsd:complexType>
  198.           <xsd:attribute name="name" type="xsd:string" use="required" />
  199.         </xsd:complexType>
  200.       </xsd:element>
  201.       <xsd:element name="xidunion">
  202.         <xsd:complexType>
  203.           <xsd:sequence>
  204.             <xsd:element name="type" type="xsd:string"
  205.                          minOccurs="1" maxOccurs="unbounded" />
  206.           </xsd:sequence>
  207.           <xsd:attribute name="name" type="xsd:string" use="required" />
  208.         </xsd:complexType>
  209.       </xsd:element>
  210.       <xsd:element name="enum">
  211.         <xsd:complexType>
  212.           <xsd:sequence minOccurs="1" maxOccurs="unbounded">
  213.             <xsd:element name="item">
  214.               <xsd:complexType>
  215.                 <xsd:group ref="expression" minOccurs="0" maxOccurs="1" />
  216.                 <xsd:attribute name="name" type="xsd:string" use="required" />
  217.               </xsd:complexType>
  218.             </xsd:element>
  219.           </xsd:sequence>
  220.           <xsd:attribute name="name" type="xsd:string" use="required" />
  221.         </xsd:complexType>
  222.       </xsd:element>
  223.       <xsd:element name="typedef">
  224.         <xsd:complexType>
  225.           <xsd:attribute name="oldname" type="xsd:string" use="required" />
  226.           <xsd:attribute name="newname" type="xsd:string" use="required" />
  227.         </xsd:complexType>
  228.       </xsd:element>
  229.       <!-- The import element allows a protocol description to reference the
  230.            declarations of another protocol description. -->
  231.       <xsd:element name="import" type="xsd:string" />
  232.     </xsd:choice>
  233.   </xsd:group>
  234. </xsd:schema>
  235.